home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1606 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: sdd.hp.com!inn
  2. From: Jeff Grimmett <jgrimm@sdd.hp.com>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: More
  5. Date: 21 Jan 1996 18:21:19 GMT
  6. Organization: Hewlett-Packard Company
  7. Message-ID: <4du06v$7in@news.sdd.hp.com>
  8. References: <9601201749.AA00046@cliffe.demon.co.uk>
  9. NNTP-Posting-Host: hpsdv330.sdd.hp.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
  14.  
  15. Steven Chapman <steve@cliffe.demon.co.uk> wrote:
  16.  
  17. >        if(!(fh = fopen("T:xx", "w")))
  18. >Work-1:Steve1.c 41 Warning 225: pointer type mismatch
  19. >                                "BPTR" does not match "struct __iobuf *"
  20.  
  21. Well, beleive your compiler, it's not lying.  fopen() returns a FILE 
  22. pointer, ie
  23.  
  24.     FILE *fp;
  25.  
  26. and what you're asking it to do is return a BPTR.  Not gonna work.
  27.  
  28. I didn't examine your code thoroughly so what you do about this just 
  29. depends on what you're going to do with the file.
  30.  
  31. If you want to pass that pointer to other AmigaDOS functions that require 
  32. a BPTR, your best option is to can the ANSI file code (fopen()) and go 
  33. directly to AmigaDOS functions like Open() and Close().  THEY operate 
  34. with the BPTR file handle quite well.
  35.  
  36. On the other hand, if all you're doing is fopen() fwrite() fread() 
  37. fclose() etc, then just change your declaration from BPTR * to FILE *.
  38.  
  39.  
  40.  
  41.